import request from "@/utils/request";

//获取考过的试卷
export function getExamedQuestions(eId) {
    return request({
        url: '/question/examed/' + eId,
        method: 'get'
    })
}

//获取没考过的试卷
export function getQuestions(eId) {
    return request({
        url: '/question/' + eId,
        method: 'get'
    })
}

//从exam里面删除题目
export function delFromExam(qId, eId) {
    return request({
        url: '/question/exam/' + qId + '/' + eId,
        method: 'DELETE'
    })
}

//添加题目
export function addQuestion(ques) {
    return request({
        url: '/question/exam',
        method: 'post',
        data: ques
    })
}

//添加题目
export function updateQuestion(ques) {
    return request({
        url: '/question',
        method: 'put',
        data: ques
    })
}

export function checkAnswer(answer) {
    return request({
        url: '/question/checkAnswer',
        method: 'post',
        data: answer
    })
}

